﻿using Core.ValidateRules.Lib;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dto.Core.Config
{
    /// <summary>
    /// 属性模式配置参数
    /// </summary>
    public class PropertyPatternConfigParamDto : CommonBaseDto
    {
        #region 上级参数雪花Id

        /// <summary>
        /// 上级参数雪花Id
        /// </summary>
        private long? @parentSid = 0;

        /// <summary>
        /// 上级参数雪花Id
        /// </summary>
        [JsonProperty("parent_sid", Order = 1)]
        [ValidateRulesRequired(ErrorMessage = "{0}不允许为空", AllowEmptyStrings = false)]
        [Display(Name = "上级参数雪花Id")]
        public virtual long? @ParentSid
        {
            get { return parentSid; }
            set
            {
                parentSid = value;
                OnPropertyChanged();
            }
        }

        #endregion 上级参数雪花Id

        #region 配置外键 etl_lib_sys_config.sid

        /// <summary>
        /// 配置外键
        /// <para>数据库类型：bigint ; 数据库值：不允许为空</para>
        /// <para>etl_lib_sys_config.sid</para>
        /// </summary>
        private long? @fkConfigSid;

        /// <summary>
        /// 配置外键
        /// <para>数据库类型：bigint ; 数据库值：不允许为空</para>
        /// <para>etl_lib_sys_config.sid</para>
        /// </summary>
        [JsonProperty("fk_config_sid", Order = 2)]
        [ValidateRulesRequired(ErrorMessage = "{0}不允许为空", AllowEmptyStrings = false)]
        [Display(Name = "配置外键")]
        public virtual long? @FkConfigSid
        {
            get { return fkConfigSid; }
            set
            {
                fkConfigSid = value;
                OnPropertyChanged();
            }
        }

        #endregion 配置外键 etl_lib_sys_config.sid

        #region 参数层级

        /// <summary>
        /// 参数层级
        /// </summary>
        private int? @paramLevel;

        /// <summary>
        /// 参数层级
        /// </summary>
        [JsonProperty("param_level", Order = 3)]
        [ValidateRulesRequired(ErrorMessage = "{0}不允许为空", AllowEmptyStrings = false)]
        [Display(Name = "参数层级")]
        public virtual int? @ParamLevel
        {
            get { return paramLevel; }
            set
            {
                paramLevel = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数层级

        #region 参数分组键

        /// <summary>
        /// 参数分组键
        /// </summary>
        private string? @groupKey;

        /// <summary>
        /// 参数分组键
        /// </summary>
        [JsonProperty("group_key", Order = 4)]
        [Display(Name = "参数分组键")]
        public virtual string? @GroupKey
        {
            get { return groupKey; }
            set
            {
                groupKey = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数分组键

        #region 参数分组名称

        /// <summary>
        /// 参数分组名称
        /// </summary>
        private string? @groupName;

        /// <summary>
        /// 参数分组名称
        /// </summary>
        [JsonProperty("group_name", Order = 5)]
        [Display(Name = "参数分组名称")]
        public virtual string? @GroupName
        {
            get { return groupName; }
            set
            {
                groupName = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数分组名称

        #region 参数类型 加载参数的实体类类型

        /// <summary>
        /// 参数类型
        /// <para>数据库类型：varchar(256)</para>
        /// <para>加载参数的实体类类型</para>
        /// </summary>
        private string? paramType;

        /// <summary>
        /// 参数类型
        /// <para>数据库类型：varchar(256)</para>
        /// <para>加载参数的实体类类型</para>
        /// </summary>
        [JsonProperty("param_type", Order = 6)]
        [Display(Name = "参数类型")]
        public virtual string? ParamType
        {
            get { return paramType; }
            set
            {
                paramType = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数类型 加载参数的实体类类型

        #region 参数键 用于反射确定参数属性

        /// <summary>
        /// 参数键
        /// <para>数据库类型：varchar(256) ; 数据库值：不允许为空</para>
        /// <para>用于反射确定参数属性</para>
        /// </summary>
        private string? @paramKey;

        /// <summary>
        /// 参数键
        /// <para>数据库类型：varchar(256) ; 数据库值：不允许为空</para>
        /// <para>用于反射确定参数属性</para>
        /// </summary>
        [JsonProperty("param_key", Order = 7)]
        [ValidateRulesRequired(ErrorMessage = "{0}不允许为空", AllowEmptyStrings = false)]
        [Display(Name = "参数键")]
        public virtual string? @ParamKey
        {
            get { return paramKey; }
            set
            {
                paramKey = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数键 用于反射确定参数属性

        #region 参数名

        /// <summary>
        /// 参数名
        /// </summary>
        private string? @paramName;

        /// <summary>
        /// 参数名
        /// </summary>
        [JsonProperty("param_name", Order = 8)]
        [Display(Name = "参数名")]
        public virtual string? @ParamName
        {
            get { return paramName; }
            set
            {
                paramName = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数名

        #region 参数值

        /// <summary>
        /// 参数值
        /// </summary>
        private string? @paramValue;

        /// <summary>
        /// 参数值
        /// </summary>
        [JsonProperty("param_value", Order = 8)]
        [Display(Name = "参数值")]
        public virtual string? @ParamValue
        {
            get { return paramValue; }
            set
            {
                paramValue = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数值

        #region 参数说明

        /// <summary>
        /// 参数说明
        /// </summary>
        private string? @paramDescription;

        /// <summary>
        /// 参数说明
        /// </summary>
        [JsonProperty("param_description", Order = 9)]
        [Display(Name = "参数说明")]
        public virtual string? @ParamDescription
        {
            get { return paramDescription; }
            set
            {
                paramDescription = value;
                OnPropertyChanged();
            }
        }

        #endregion 参数说明

        #region 是否显示 0:否;1:是

        /// <summary>
        /// 是否显示
        /// <para>数据库类型：tinyint ; 数据库默认值：1</para>
        /// <para>0:否;1:是</para>
        /// </summary>
        private bool? @isVisible = true;

        /// <summary>
        /// 是否显示
        /// <para>数据库类型：tinyint ; 数据库默认值：1</para>
        /// <para>0:否;1:是</para>
        /// </summary>
        [JsonProperty("is_visible", Order = 10)]
        [Display(Name = "是否显示")]
        public virtual bool? @IsVisible
        {
            get { return isVisible; }
            set
            {
                isVisible = value;
                OnPropertyChanged();
            }
        }

        #endregion 是否显示 0:否;1:是

    }
}
